package com.qf.service.impl;

import com.qf.dao.CategoryDao;
import com.qf.dao.impl.CategoryDaoImpl;
import com.qf.pojo.Category;
import com.qf.service.CategoryService;

import java.sql.SQLException;
import java.util.List;

public class CategoryServiceImpl implements CategoryService {
    @Override
    public List<Category> findCategory() {
        //调用数据访问层
        try {
            CategoryDao categoryDao = new CategoryDaoImpl();
            List<Category> list = categoryDao.selectCategory();
            //判断
            if (list!=null){
                return list;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
